﻿using System.ComponentModel.DataAnnotations;

namespace Step4.Unit5.Models
{
    public class Student
    {
        [Display(Name="账号")]
        [Required(ErrorMessage ="请输入账号")]
        public String? Account { get; set; }

        [Display(Name = "密码")]
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "请输入账号")]
        public String? Pwd{ get; set; }

        [Display(Name = "确认密码")]
        [DataType(DataType.Password)]
        [Required(ErrorMessage = "两次输入的密码不一致")]
        public String? ConfirmPassword { get; set; }

        [Display(Name = "爱好")]
        public String[]? Hobby { get; set; }

        [Display(Name = "性别")]
        public string? Sex { get; set; }

        [Display(Name = "祖籍")]
        [Required(ErrorMessage = "请选择祖籍！")]
        [Range(1, int.MaxValue, ErrorMessage = "请选择祖籍")]
        public int Province { get; set; }

        [Display(Name = "生日")]
        [DataType(DataType.Date)]
        [Required(ErrorMessage = "请输入你的生日")]
        public DateTime Birthday { get; set; }

        [Display(Name = "简介")]
        public String? Description { get; set; }
    }
}
